* Start running here on CBS servcer. Note: this requires a source variable called cn8, which contains 8-digit cn codes in numerical format
	gen cat = ""
	replace cat = "none"	if cn8>= 82010000	& cn8< 82013000
	replace cat = "none"	if cn8>= 82013000	& cn8< 82014000
	replace cat = "none"	if cn8>= 82014000	& cn8< 82015000
	replace cat = "none"	if cn8>= 82015000	& cn8< 82016000
	replace cat = "none"	if cn8>= 82016000	& cn8< 82019000
	replace cat = "none"	if cn8>= 82019000	& cn8< 82020000
	replace cat = "tl"	if cn8>= 82020000	& cn8< 82022000
	replace cat = "tl"	if cn8>= 82022000	& cn8< 82023100
	replace cat = "tl"	if cn8>= 82023100	& cn8< 82023900
	replace cat = "tl"	if cn8>= 82023900	& cn8< 82024000
	replace cat = "tl"	if cn8>= 82024000	& cn8< 82029100
	replace cat = "tl"	if cn8>= 82029100	& cn8< 82029900
	replace cat = "tl"	if cn8>= 82029900	& cn8< 82031000
	replace cat = "tl"	if cn8>= 82031000	& cn8< 82032000
	replace cat = "tl"	if cn8>= 82032000	& cn8< 82033000
	replace cat = "tl"	if cn8>= 82033000	& cn8< 82034000
	replace cat = "tl"	if cn8>= 82034000	& cn8< 82041100
	replace cat = "tl"	if cn8>= 82041100	& cn8< 82041200
	replace cat = "tl"	if cn8>= 82041200	& cn8< 82042000
	replace cat = "tl"	if cn8>= 82042000	& cn8< 82051000
	replace cat = "tl"	if cn8>= 82051000	& cn8< 82052000
	replace cat = "tl"	if cn8>= 82052000	& cn8< 82053000
	replace cat = "tl"	if cn8>= 82053000	& cn8< 82054000
	replace cat = "tl"	if cn8>= 82054000	& cn8< 82055100
	replace cat = "tl"	if cn8>= 82055100	& cn8< 82055900
	replace cat = "tl"	if cn8>= 82055900	& cn8< 82056000
	replace cat = "tl"	if cn8>= 82056000	& cn8< 82057000
	replace cat = "tl"	if cn8>= 82057000	& cn8< 82059000
	replace cat = "tl"	if cn8>= 82059000	& cn8< 82060000
	replace cat = "tl"	if cn8>= 82060000	& cn8< 82071300
	replace cat = "tl"	if cn8>= 82071300	& cn8< 82071900
	replace cat = "tl"	if cn8>= 82071900	& cn8< 82072000
	replace cat = "tl"	if cn8>= 82072000	& cn8< 82073000
	replace cat = "tl"	if cn8>= 82073000	& cn8< 82074000
	replace cat = "tl"	if cn8>= 82074000	& cn8< 82075000
	replace cat = "tl"	if cn8>= 82075000	& cn8< 82076000
	replace cat = "tl"	if cn8>= 82076000	& cn8< 82077000
	replace cat = "tl"	if cn8>= 82077000	& cn8< 82078000
	replace cat = "tl"	if cn8>= 82078000	& cn8< 82079000
	replace cat = "tl"	if cn8>= 82079000	& cn8< 82081000
	replace cat = "tl"	if cn8>= 82081000	& cn8< 82082000
	replace cat = "tl"	if cn8>= 82082000	& cn8< 82083000
	replace cat = "tl"	if cn8>= 82083000	& cn8< 82084000
	replace cat = "tl"	if cn8>= 82084000	& cn8< 82089000
	replace cat = "tl"	if cn8>= 82089000	& cn8< 82090000
	replace cat = "tl"	if cn8>= 82090000	& cn8< 82100000
	replace cat = "tl"	if cn8>= 82100000	& cn8< 82111000
	replace cat = "tl"	if cn8>= 82111000	& cn8< 82119100
	replace cat = "tl"	if cn8>= 82119100	& cn8< 82119200
	replace cat = "tl"	if cn8>= 82119200	& cn8< 82119300
	replace cat = "tl"	if cn8>= 82119300	& cn8< 82119400
	replace cat = "tl"	if cn8>= 82119400	& cn8< 82119500
	replace cat = "tl"	if cn8>= 82119500	& cn8< 82121000
	replace cat = "tl"	if cn8>= 82121000	& cn8< 82122000
	replace cat = "tl"	if cn8>= 82122000	& cn8< 82129000
	replace cat = "tl"	if cn8>= 82129000	& cn8< 82130000
	replace cat = "none"	if cn8>= 82130000	& cn8< 82141000
	replace cat = "none"	if cn8>= 82141000	& cn8< 82142000
	replace cat = "none"	if cn8>= 82142000	& cn8< 82149000
	replace cat = "none"	if cn8>= 82149000	& cn8< 82151000
	replace cat = "none"	if cn8>= 82151000	& cn8< 82152000
	replace cat = "none"	if cn8>= 82152000	& cn8< 82159100
	replace cat = "none"	if cn8>= 82159100	& cn8< 82159900
	replace cat = "none"	if cn8>= 82159900	& cn8< 84011000
	replace cat = "none"	if cn8>= 84011000	& cn8< 84012000
	replace cat = "none"	if cn8>= 84012000	& cn8< 84013000
	replace cat = "none"	if cn8>= 84013000	& cn8< 84014000
	replace cat = "none"	if cn8>= 84014000	& cn8< 84020000
	replace cat = "mac"	if cn8>= 84020000	& cn8< 84021200
	replace cat = "mac"	if cn8>= 84021200	& cn8< 84021900
	replace cat = "mac"	if cn8>= 84021900	& cn8< 84022000
	replace cat = "mac"	if cn8>= 84022000	& cn8< 84029000
	replace cat = "mac"	if cn8>= 84029000	& cn8< 84030000
	replace cat = "none"	if cn8>= 84030000	& cn8< 84039000
	replace cat = "none"	if cn8>= 84039000	& cn8< 84040000
	replace cat = "mac"	if cn8>= 84040000	& cn8< 84042000
	replace cat = "mac"	if cn8>= 84042000	& cn8< 84049000
	replace cat = "mac"	if cn8>= 84049000	& cn8< 84051000
	replace cat = "mac"	if cn8>= 84051000	& cn8< 84059000
	replace cat = "mac"	if cn8>= 84059000	& cn8< 84061000
	replace cat = "mac"	if cn8>= 84061000	& cn8< 84068100
	replace cat = "mac"	if cn8>= 84068100	& cn8< 84068200
	replace cat = "mac"	if cn8>= 84068200	& cn8< 84069000
	replace cat = "mac"	if cn8>= 84069000	& cn8< 84071000
	replace cat = "mac"	if cn8>= 84071000	& cn8< 84072100
	replace cat = "mac"	if cn8>= 84072100	& cn8< 84072900
	replace cat = "mac"	if cn8>= 84072900	& cn8< 84073100
	replace cat = "mac"	if cn8>= 84073100	& cn8< 84073200
	replace cat = "mac"	if cn8>= 84073200	& cn8< 84073300
	replace cat = "mac"	if cn8>= 84073300	& cn8< 84073400
	replace cat = "mac"	if cn8>= 84073400	& cn8< 84079000
	replace cat = "mac"	if cn8>= 84079000	& cn8< 84081000
	replace cat = "mac"	if cn8>= 84081000	& cn8< 84082000
	replace cat = "mac"	if cn8>= 84082000	& cn8< 84089000
	replace cat = "mac"	if cn8>= 84089000	& cn8< 84091000
	replace cat = "mac"	if cn8>= 84091000	& cn8< 84099100
	replace cat = "mac"	if cn8>= 84099100	& cn8< 84099900
	replace cat = "mac"	if cn8>= 84099900	& cn8< 84101100
	replace cat = "mac"	if cn8>= 84101100	& cn8< 84101200
	replace cat = "mac"	if cn8>= 84101200	& cn8< 84101300
	replace cat = "mac"	if cn8>= 84101300	& cn8< 84109000
	replace cat = "mac"	if cn8>= 84109000	& cn8< 84111100
	replace cat = "mac"	if cn8>= 84111100	& cn8< 84111200
	replace cat = "mac"	if cn8>= 84111200	& cn8< 84112100
	replace cat = "mac"	if cn8>= 84112100	& cn8< 84112200
	replace cat = "mac"	if cn8>= 84112200	& cn8< 84118100
	replace cat = "mac"	if cn8>= 84118100	& cn8< 84118200
	replace cat = "mac"	if cn8>= 84118200	& cn8< 84119100
	replace cat = "mac"	if cn8>= 84119100	& cn8< 84119900
	replace cat = "mac"	if cn8>= 84119900	& cn8< 84121000
	replace cat = "mac"	if cn8>= 84121000	& cn8< 84122100
	replace cat = "mac"	if cn8>= 84122100	& cn8< 84122900
	replace cat = "mac"	if cn8>= 84122900	& cn8< 84123100
	replace cat = "mac"	if cn8>= 84123100	& cn8< 84123900
	replace cat = "mac"	if cn8>= 84123900	& cn8< 84128000
	replace cat = "mac"	if cn8>= 84128000	& cn8< 84129000
	replace cat = "mac"	if cn8>= 84129000	& cn8< 84131100
	replace cat = "mac"	if cn8>= 84131100	& cn8< 84131900
	replace cat = "mac"	if cn8>= 84131900	& cn8< 84132000
	replace cat = "mac"	if cn8>= 84132000	& cn8< 84133000
	replace cat = "mac"	if cn8>= 84133000	& cn8< 84134000
	replace cat = "mac"	if cn8>= 84134000	& cn8< 84135000
	replace cat = "mac"	if cn8>= 84135000	& cn8< 84136000
	replace cat = "mac"	if cn8>= 84136000	& cn8< 84137000
	replace cat = "mac"	if cn8>= 84137000	& cn8< 84138100
	replace cat = "mac"	if cn8>= 84138100	& cn8< 84138200
	replace cat = "mac"	if cn8>= 84138200	& cn8< 84139100
	replace cat = "mac"	if cn8>= 84139100	& cn8< 84139200
	replace cat = "mac"	if cn8>= 84139200	& cn8< 84141000
	replace cat = "mac"	if cn8>= 84141000	& cn8< 84142000
	replace cat = "mac"	if cn8>= 84142000	& cn8< 84143000
	replace cat = "mac"	if cn8>= 84143000	& cn8< 84144000
	replace cat = "mac"	if cn8>= 84144000	& cn8< 84145100
	replace cat = "mac"	if cn8>= 84145100	& cn8< 84145900
	replace cat = "mac"	if cn8>= 84145900	& cn8< 84146000
	replace cat = "mac"	if cn8>= 84146000	& cn8< 84148000
	replace cat = "mac"	if cn8>= 84148000	& cn8< 84149000
	replace cat = "mac"	if cn8>= 84149000	& cn8< 84151000
	replace cat = "mac"	if cn8>= 84151000	& cn8< 84152000
	replace cat = "mac"	if cn8>= 84152000	& cn8< 84158100
	replace cat = "mac"	if cn8>= 84158100	& cn8< 84158200
	replace cat = "mac"	if cn8>= 84158200	& cn8< 84158300
	replace cat = "mac"	if cn8>= 84158300	& cn8< 84159000
	replace cat = "mac"	if cn8>= 84159000	& cn8< 84161000
	replace cat = "mac"	if cn8>= 84161000	& cn8< 84162000
	replace cat = "mac"	if cn8>= 84162000	& cn8< 84163000
	replace cat = "mac"	if cn8>= 84163000	& cn8< 84169000
	replace cat = "mac"	if cn8>= 84169000	& cn8< 84171000
	replace cat = "mac"	if cn8>= 84171000	& cn8< 84172000
	replace cat = "mac"	if cn8>= 84172000	& cn8< 84178000
	replace cat = "mac"	if cn8>= 84178000	& cn8< 84179000
	replace cat = "mac"	if cn8>= 84179000	& cn8< 84181000
	replace cat = "mac"	if cn8>= 84181000	& cn8< 84182100
	replace cat = "mac"	if cn8>= 84182100	& cn8< 84182900
	replace cat = "mac"	if cn8>= 84182900	& cn8< 84183000
	replace cat = "mac"	if cn8>= 84183000	& cn8< 84184000
	replace cat = "mac"	if cn8>= 84184000	& cn8< 84185000
	replace cat = "mac"	if cn8>= 84185000	& cn8< 84186100
	replace cat = "mac"	if cn8>= 84186100	& cn8< 84186900
	replace cat = "mac"	if cn8>= 84186900	& cn8< 84189100
	replace cat = "mac"	if cn8>= 84189100	& cn8< 84189900
	replace cat = "mac"	if cn8>= 84189900	& cn8< 84191100
	replace cat = "mac"	if cn8>= 84191100	& cn8< 84191900
	replace cat = "mac"	if cn8>= 84191900	& cn8< 84192000
	replace cat = "mac"	if cn8>= 84192000	& cn8< 84193100
	replace cat = "mac"	if cn8>= 84193100	& cn8< 84193200
	replace cat = "mac"	if cn8>= 84193200	& cn8< 84193900
	replace cat = "mac"	if cn8>= 84193900	& cn8< 84194000
	replace cat = "mac"	if cn8>= 84194000	& cn8< 84195000
	replace cat = "mac"	if cn8>= 84195000	& cn8< 84196000
	replace cat = "mac"	if cn8>= 84196000	& cn8< 84198100
	replace cat = "mac"	if cn8>= 84198100	& cn8< 84198900
	replace cat = "mac"	if cn8>= 84198900	& cn8< 84199000
	replace cat = "mac"	if cn8>= 84199000	& cn8< 84201000
	replace cat = "mac"	if cn8>= 84201000	& cn8< 84209100
	replace cat = "mac"	if cn8>= 84209100	& cn8< 84209900
	replace cat = "mac"	if cn8>= 84209900	& cn8< 84211100
	replace cat = "mac"	if cn8>= 84211100	& cn8< 84211200
	replace cat = "mac"	if cn8>= 84211200	& cn8< 84211900
	replace cat = "mac"	if cn8>= 84211900	& cn8< 84212100
	replace cat = "mac"	if cn8>= 84212100	& cn8< 84212200
	replace cat = "mac"	if cn8>= 84212200	& cn8< 84212300
	replace cat = "mac"	if cn8>= 84212300	& cn8< 84212900
	replace cat = "mac"	if cn8>= 84212900	& cn8< 84213100
	replace cat = "mac"	if cn8>= 84213100	& cn8< 84213900
	replace cat = "mac"	if cn8>= 84213900	& cn8< 84219100
	replace cat = "mac"	if cn8>= 84219100	& cn8< 84219900
	replace cat = "mac"	if cn8>= 84219900	& cn8< 84221100
	replace cat = "mac"	if cn8>= 84221100	& cn8< 84221900
	replace cat = "mac"	if cn8>= 84221900	& cn8< 84222000
	replace cat = "mac"	if cn8>= 84222000	& cn8< 84223000
	replace cat = "mac"	if cn8>= 84223000	& cn8< 84224000
	replace cat = "mac"	if cn8>= 84224000	& cn8< 84229000
	replace cat = "mac"	if cn8>= 84229000	& cn8< 84231000
	replace cat = "mac"	if cn8>= 84231000	& cn8< 84232000
	replace cat = "mac"	if cn8>= 84232000	& cn8< 84233000
	replace cat = "mac"	if cn8>= 84233000	& cn8< 84238100
	replace cat = "mac"	if cn8>= 84238100	& cn8< 84238200
	replace cat = "mac"	if cn8>= 84238200	& cn8< 84238900
	replace cat = "mac"	if cn8>= 84238900	& cn8< 84239000
	replace cat = "mac"	if cn8>= 84239000	& cn8< 84241000
	replace cat = "mac"	if cn8>= 84241000	& cn8< 84242000
	replace cat = "mac"	if cn8>= 84242000	& cn8< 84243000
	replace cat = "mac"	if cn8>= 84243000	& cn8< 84248100
	replace cat = "mac"	if cn8>= 84248100	& cn8< 84248900
	replace cat = "mac"	if cn8>= 84248900	& cn8< 84249000
	replace cat = "mac"	if cn8>= 84249000	& cn8< 84251100
	replace cat = "mac_other_transfer"	if cn8>= 84251100	& cn8< 84251900
	replace cat = "mac"	if cn8>= 84251900	& cn8< 84253100
	replace cat = "mac_other_transfer"	if cn8>= 84253100	& cn8< 84253900
	replace cat = "mac"	if cn8>= 84253900	& cn8< 84254100
	replace cat = "mac"	if cn8>= 84254100	& cn8< 84254200
	replace cat = "mac_other_transfer"	if cn8>= 84254200	& cn8< 84254900
	replace cat = "mac"	if cn8>= 84254900	& cn8< 84261100
	replace cat = "mac_other_transfer"	if cn8>= 84261100	& cn8< 84261200
	replace cat = "mac"	if cn8>= 84261200	& cn8< 84261900
	replace cat = "mac"	if cn8>= 84261900	& cn8< 84262000
	replace cat = "mac"	if cn8>= 84262000	& cn8< 84263000
	replace cat = "mac"	if cn8>= 84263000	& cn8< 84264100
	replace cat = "mac"	if cn8>= 84264100	& cn8< 84264900
	replace cat = "mac"	if cn8>= 84264900	& cn8< 84269100
	replace cat = "mac"	if cn8>= 84269100	& cn8< 84269900
	replace cat = "mac"	if cn8>= 84269900	& cn8< 84270000
	replace cat = "mac_other_transfer"	if cn8>= 84270000	& cn8< 84272000
	replace cat = "mac_other_transfer"	if cn8>= 84272000	& cn8< 84279000
	replace cat = "mac_other_transfer"	if cn8>= 84279000	& cn8< 84281000
	replace cat = "mac_other_transfer"	if cn8>= 84281000	& cn8< 84282000
	replace cat = "mac_other_transfer"	if cn8>= 84282000	& cn8< 84283100
	replace cat = "mac"	if cn8>= 84283100	& cn8< 84283100
	replace cat = "mac_aut_transfer"	if cn8>= 84283100	& cn8< 84283300
	replace cat = "mac_aut_transfer"	if cn8>= 84283300	& cn8< 84283900
	replace cat = "mac_aut_transfer"	if cn8>= 84283900	& cn8< 84284000
	replace cat = "mac"	if cn8>= 84284000	& cn8< 84286000
	replace cat = "mac"	if cn8>= 84286000	& cn8< 84289000
	replace cat = "mac"	if cn8>= 84289000	& cn8< 84290000
	replace cat = "none"	if cn8>= 84290000	& cn8< 84291900
	replace cat = "none"	if cn8>= 84291900	& cn8< 84292000
	replace cat = "none"	if cn8>= 84292000	& cn8< 84293000
	replace cat = "none"	if cn8>= 84293000	& cn8< 84294000
	replace cat = "none"	if cn8>= 84294000	& cn8< 84295100
	replace cat = "none"	if cn8>= 84295100	& cn8< 84295200
	replace cat = "none"	if cn8>= 84295200	& cn8< 84295900
	replace cat = "none"	if cn8>= 84295900	& cn8< 84301000
	replace cat = "none"	if cn8>= 84301000	& cn8< 84302000
	replace cat = "none"	if cn8>= 84302000	& cn8< 84303100
	replace cat = "none"	if cn8>= 84303100	& cn8< 84303900
	replace cat = "none"	if cn8>= 84303900	& cn8< 84304100
	replace cat = "none"	if cn8>= 84304100	& cn8< 84304900
	replace cat = "none"	if cn8>= 84304900	& cn8< 84305000
	replace cat = "none"	if cn8>= 84305000	& cn8< 84306100
	replace cat = "none"	if cn8>= 84306100	& cn8< 84306900
	replace cat = "none"	if cn8>= 84306900	& cn8< 84311000
	replace cat = "none"	if cn8>= 84311000	& cn8< 84312000
	replace cat = "none"	if cn8>= 84312000	& cn8< 84313100
	replace cat = "none"	if cn8>= 84313100	& cn8< 84313900
	replace cat = "none"	if cn8>= 84313900	& cn8< 84314100
	replace cat = "none"	if cn8>= 84314100	& cn8< 84314200
	replace cat = "none"	if cn8>= 84314200	& cn8< 84314300
	replace cat = "none"	if cn8>= 84314300	& cn8< 84314900
	replace cat = "none"	if cn8>= 84314900	& cn8< 84320000	
	replace cat = "agri"	if cn8>= 84320000	& cn8< 84322100
	replace cat = "agri"	if cn8>= 84322100	& cn8< 84322900
	replace cat = "agri"	if cn8>= 84322900	& cn8< 84323000
	replace cat = "agri"	if cn8>= 84323000	& cn8< 84324000
	replace cat = "agri"	if cn8>= 84324000	& cn8< 84328000
	replace cat = "agri"	if cn8>= 84328000	& cn8< 84329000
	replace cat = "agri"	if cn8>= 84329000	& cn8< 84331100
	replace cat = "agri"	if cn8>= 84331100	& cn8< 84331900
	replace cat = "agri"	if cn8>= 84331900	& cn8< 84332000
	replace cat = "agri"	if cn8>= 84332000	& cn8< 84333000
	replace cat = "agri"	if cn8>= 84333000	& cn8< 84334000
	replace cat = "agri"	if cn8>= 84334000	& cn8< 84335100
	replace cat = "agri"	if cn8>= 84335100	& cn8< 84335200
	replace cat = "agri"	if cn8>= 84335200	& cn8< 84335300
	replace cat = "agri"	if cn8>= 84335300	& cn8< 84335900
	replace cat = "agri"	if cn8>= 84335900	& cn8< 84336000
	replace cat = "agri"	if cn8>= 84336000	& cn8< 84339000
	replace cat = "agri"	if cn8>= 84339000	& cn8< 84341000
	replace cat = "agri"	if cn8>= 84341000	& cn8< 84342000
	replace cat = "agri"	if cn8>= 84342000	& cn8< 84349000
	replace cat = "agri"	if cn8>= 84349000	& cn8< 84351000
	replace cat = "agri"	if cn8>= 84351000	& cn8< 84359000
	replace cat = "agri"	if cn8>= 84359000	& cn8< 84361000
	replace cat = "agri"	if cn8>= 84361000	& cn8< 84362100
	replace cat = "agri"	if cn8>= 84362100	& cn8< 84362900
	replace cat = "agri"	if cn8>= 84362900	& cn8< 84368000
	replace cat = "agri"	if cn8>= 84368000	& cn8< 84369100
	replace cat = "agri"	if cn8>= 84369100	& cn8< 84369900
	replace cat = "agri"	if cn8>= 84369900	& cn8< 84371000
	replace cat = "agri"	if cn8>= 84371000	& cn8< 84378000
	replace cat = "agri"	if cn8>= 84378000	& cn8< 84379000
	replace cat = "agri"	if cn8>= 84379000	& cn8< 84380000	
	replace cat = "mac_foodprep"	if cn8>= 84380000	& cn8< 84382000
	replace cat = "mac_foodprep"	if cn8>= 84382000	& cn8< 84383000
	replace cat = "mac_foodprep"	if cn8>= 84383000	& cn8< 84384000
	replace cat = "mac_foodprep"	if cn8>= 84384000	& cn8< 84385000
	replace cat = "mac_foodprep"	if cn8>= 84385000	& cn8< 84386000
	replace cat = "mac_foodprep"	if cn8>= 84386000	& cn8< 84388000
	replace cat = "mac_foodprep"	if cn8>= 84388000	& cn8< 84389000
	replace cat = "mac_foodprep"	if cn8>= 84389000	& cn8< 84390000	
	replace cat = "mac"	if cn8>= 84390000	& cn8< 84392000
	replace cat = "mac"	if cn8>= 84392000	& cn8< 84393000
	replace cat = "mac"	if cn8>= 84393000	& cn8< 84399100
	replace cat = "mac"	if cn8>= 84399100	& cn8< 84399900
	replace cat = "mac"	if cn8>= 84399900	& cn8< 84401000
	replace cat = "mac"	if cn8>= 84401000	& cn8< 84409000
	replace cat = "mac"	if cn8>= 84409000	& cn8< 84411000
	replace cat = "mac"	if cn8>= 84411000	& cn8< 84412000
	replace cat = "mac"	if cn8>= 84412000	& cn8< 84413000
	replace cat = "mac"	if cn8>= 84413000	& cn8< 84414000
	replace cat = "mac"	if cn8>= 84414000	& cn8< 84418000
	replace cat = "mac"	if cn8>= 84418000	& cn8< 84419000
	replace cat = "mac"	if cn8>= 84419000	& cn8< 84423000
	replace cat = "mac"	if cn8>= 84423000	& cn8< 84424000
	replace cat = "mac"	if cn8>= 84424000	& cn8< 84425000
	replace cat = "mac"	if cn8>= 84425000	& cn8< 84431100
	replace cat = "mac"	if cn8>= 84431100	& cn8< 84431200
	replace cat = "mac"	if cn8>= 84431200	& cn8< 84431300
	replace cat = "mac"	if cn8>= 84431300	& cn8< 84431400
	replace cat = "mac"	if cn8>= 84431400	& cn8< 84431500
	replace cat = "mac"	if cn8>= 84431500	& cn8< 84431600
	replace cat = "mac"	if cn8>= 84431600	& cn8< 84431700
	replace cat = "mac"	if cn8>= 84431700	& cn8< 84431900
	replace cat = "mac"	if cn8>= 84431900	& cn8< 84433100
	replace cat = "mac"	if cn8>= 84433100	& cn8< 84433200
	replace cat = "mac"	if cn8>= 84433200	& cn8< 84433900
	replace cat = "mac"	if cn8>= 84433900	& cn8< 84439100
	replace cat = "mac"	if cn8>= 84439100	& cn8< 84439900
	replace cat = "mac"	if cn8>= 84439900	& cn8< 84440000
	replace cat = "mac_other_textile"	if cn8>= 84440000	& cn8< 84451100
	replace cat = "mac_other_textile"	if cn8>= 84451100	& cn8< 84451200
	replace cat = "mac_other_textile"	if cn8>= 84451200	& cn8< 84451300
	replace cat = "mac_other_textile"	if cn8>= 84451300	& cn8< 84451900
	replace cat = "mac_other_textile"	if cn8>= 84451900	& cn8< 84452000
	replace cat = "mac_other_textile"	if cn8>= 84452000	& cn8< 84453000
	replace cat = "mac_other_textile"	if cn8>= 84453000	& cn8< 84454000
	replace cat = "mac_other_textile"	if cn8>= 84454000	& cn8< 84459000
	replace cat = "mac_other_textile"	if cn8>= 84459000	& cn8< 84460000	
	replace cat = "mac_weavknit_textile"	if cn8>= 84460000	& cn8< 84462100
	replace cat = "mac_weavknit_textile"	if cn8>= 84462100	& cn8< 84462900
	replace cat = "mac_weavknit_textile"	if cn8>= 84462900	& cn8< 84463000
	replace cat = "mac_weavknit_textile"	if cn8>= 84463000	& cn8< 84471100
	replace cat = "mac_weavknit_textile"	if cn8>= 84471100	& cn8< 84471200
	replace cat = "mac_weavknit_textile"	if cn8>= 84471200	& cn8< 84472000
	replace cat = "mac_weavknit_textile"	if cn8>= 84472000	& cn8< 84479000
	replace cat = "mac_weavknit_textile"	if cn8>= 84479000	& cn8< 84481000	
	replace cat = "mac_other_textile"	if cn8>= 84481000	& cn8< 84481900
	replace cat = "mac_other_textile"	if cn8>= 84481900	& cn8< 84482000
	replace cat = "mac_other_textile"	if cn8>= 84482000	& cn8< 84483100
	replace cat = "mac_other_textile"	if cn8>= 84483100	& cn8< 84483200
	replace cat = "mac_other_textile"	if cn8>= 84483200	& cn8< 84483300
	replace cat = "mac_other_textile"	if cn8>= 84483300	& cn8< 84483900
	replace cat = "mac_other_textile"	if cn8>= 84483900	& cn8< 84484200
	replace cat = "mac_other_textile"	if cn8>= 84484200	& cn8< 84484900
	replace cat = "mac_other_textile"	if cn8>= 84484900	& cn8< 84485100
	replace cat = "mac_other_textile"	if cn8>= 84485100	& cn8< 84485900
	replace cat = "mac_other_textile"	if cn8>= 84485900	& cn8< 84490000
	replace cat = "mac_other_textile"	if cn8>= 84490000	& cn8< 84501100
	replace cat = "mac"	if cn8>= 84501100	& cn8< 84501200
	replace cat = "mac"	if cn8>= 84501200	& cn8< 84501900
	replace cat = "mac"	if cn8>= 84501900	& cn8< 84502000
	replace cat = "mac"	if cn8>= 84502000	& cn8< 84509000
	replace cat = "mac"	if cn8>= 84509000	& cn8< 84511000
	replace cat = "mac_other_textile"	if cn8>= 84511000	& cn8< 84512100
	replace cat = "mac_other_textile"	if cn8>= 84512100	& cn8< 84512900
	replace cat = "mac_other_textile"	if cn8>= 84512900	& cn8< 84513000
	replace cat = "mac_other_textile"	if cn8>= 84513000	& cn8< 84514000
	replace cat = "mac_other_textile"	if cn8>= 84514000	& cn8< 84515000
	replace cat = "mac_other_textile"	if cn8>= 84515000	& cn8< 84518000
	replace cat = "mac_other_textile"	if cn8>= 84518000	& cn8< 84519000
	replace cat = "mac_other_textile"	if cn8>= 84519000	& cn8< 84521000
	replace cat = "mac_other_textile"	if cn8>= 84521000	& cn8< 84522100
	replace cat = "mac_weavknit_textile"	if cn8>= 84522100	& cn8< 84522900
	replace cat = "mac_other_textile"	if cn8>= 84522900	& cn8< 84523000
	replace cat = "mac_other_textile"	if cn8>= 84523000	& cn8< 84529000
	replace cat = "mac_other_textile"	if cn8>= 84529000	& cn8< 84531000
	replace cat = "mac_other_textile"	if cn8>= 84531000	& cn8< 84532000
	replace cat = "mac_other_textile"	if cn8>= 84532000	& cn8< 84538000
	replace cat = "mac_other_textile"	if cn8>= 84538000	& cn8< 84539000
	replace cat = "mac_other_textile"	if cn8>= 84539000	& cn8< 84540000	
	replace cat = "mac"	if cn8>= 84540000	& cn8< 84542000
	replace cat = "mac"	if cn8>= 84542000	& cn8< 84543000
	replace cat = "mac"	if cn8>= 84543000	& cn8< 84549000
	replace cat = "mac"	if cn8>= 84549000	& cn8< 84551000
	replace cat = "mac"	if cn8>= 84551000	& cn8< 84552100
	replace cat = "mac"	if cn8>= 84552100	& cn8< 84552200
	replace cat = "mac"	if cn8>= 84552200	& cn8< 84553000
	replace cat = "mac"	if cn8>= 84553000	& cn8< 84559000
	replace cat = "mac"	if cn8>= 84559000	& cn8< 84560000
	replace cat = "mac_mactl"	if cn8>= 84560000	& cn8< 84562000
	replace cat = "mac_mactl"	if cn8>= 84562000	& cn8< 84563000
	replace cat = "mac_mactl"	if cn8>= 84563000	& cn8< 84569000
	replace cat = "mac_mactl"	if cn8>= 84569000	& cn8< 84570000	
	replace cat = "mac"	if cn8>= 84570000	& cn8< 84572000
	replace cat = "mac"	if cn8>= 84572000	& cn8< 84573000
	replace cat = "mac_aut_transfer"	if cn8>= 84573000	& cn8< 84581100
	replace cat = "mac_numctrl"	if cn8>= 84581100	& cn8< 84581900
	replace cat = "mac_not_numctrl"	if cn8>= 84581900	& cn8< 84589100
	replace cat = "mac_numctrl"	if cn8>= 84589100	& cn8< 84589900
	replace cat = "mac_not_numctrl"	if cn8>= 84589900	& cn8< 84590000	
	replace cat = "mac_mactl"	if cn8>= 84590000	& cn8< 84592100
	replace cat = "mac_numctrl"	if cn8>= 84592100	& cn8< 84592900
	replace cat = "mac_not_numctrl"	if cn8>= 84592900	& cn8< 84593100
	replace cat = "mac_numctrl"	if cn8>= 84593100	& cn8< 84593900
	replace cat = "mac_not_numctrl"	if cn8>= 84593900	& cn8< 84594000
	replace cat = "mac_mactl"	if cn8>= 84594000	& cn8< 84594100
	replace cat = "mac_numctrl"	if cn8>= 84594100	& cn8< 84594900
	replace cat = "mac_mactl"	if cn8>= 84594900	& cn8< 84595100
	replace cat = "mac_numctrl"	if cn8>= 84595100	& cn8< 84595900
	replace cat = "mac_not_numctrl"	if cn8>= 84595900	& cn8< 84596100
	replace cat = "mac_numctrl"	if cn8>= 84596100	& cn8< 84596900
	replace cat = "mac_not_numctrl"	if cn8>= 84596900	& cn8< 84597000
	replace cat = "mac_mactl"	if cn8>= 84597000	& cn8< 84601100
	replace cat = "mac_numctrl"	if cn8>= 84601100	& cn8< 84601900
	replace cat = "mac_not_numctrl"	if cn8>= 84601900	& cn8< 84602100
	replace cat = "mac_numctrl"	if cn8>= 84602100	& cn8< 84602900
	replace cat = "mac_not_numctrl"	if cn8>= 84602900	& cn8< 84603100
	replace cat = "mac_numctrl"	if cn8>= 84603100	& cn8< 84603900
	replace cat = "mac_not_numctrl"	if cn8>= 84603900	& cn8< 84604000
	replace cat = "mac_mactl"	if cn8>= 84604000	& cn8< 84604010
	replace cat = "mac_numctrl"	if cn8>= 84604010	& cn8< 84604090
	replace cat = "mac_mactl"	if cn8>= 84604090	& cn8< 84609000
	replace cat = "mac_mactl"	if cn8>= 84609000	& cn8< 84612000
	replace cat = "mac_mactl"	if cn8>= 84612000	& cn8< 84613000
	replace cat = "mac_mactl"	if cn8>= 84613000	& cn8< 84614000
	replace cat = "mac_mactl"	if cn8>= 84614000	& cn8< 84615000
	replace cat = "mac_mactl"	if cn8>= 84615000	& cn8< 84619000
	replace cat = "mac_mactl"	if cn8>= 84619000	& cn8< 84621000
	replace cat = "mac_mactl"	if cn8>= 84621000	& cn8< 84622100
	replace cat = "mac_numctrl"	if cn8>= 84622100	& cn8< 84622900
	replace cat = "mac_not_numctrl"	if cn8>= 84622900	& cn8< 84623100
	replace cat = "mac_numctrl"	if cn8>= 84623100	& cn8< 84623900
	replace cat = "mac_not_numctrl"	if cn8>= 84623900	& cn8< 84624100
	replace cat = "mac_numctrl"	if cn8>= 84624100	& cn8< 84624900
	replace cat = "mac_not_numctrl"	if cn8>= 84624900	& cn8< 84629100
	replace cat = "mac_mactl"	if cn8>= 84629100	& cn8< 84629900
	replace cat = "mac_mactl"	if cn8>= 84629900	& cn8< 84631000
	replace cat = "mac_mactl"	if cn8>= 84631000	& cn8< 84632000
	replace cat = "mac_mactl"	if cn8>= 84632000	& cn8< 84633000
	replace cat = "mac_mactl"	if cn8>= 84633000	& cn8< 84639000
	replace cat = "mac_mactl"	if cn8>= 84639000	& cn8< 84641000
	replace cat = "mac_mactl"	if cn8>= 84641000	& cn8< 84642000
	replace cat = "mac_mactl"	if cn8>= 84642000	& cn8< 84649000
	replace cat = "mac_mactl"	if cn8>= 84649000	& cn8< 84651000
	replace cat = "mac_mactl"	if cn8>= 84651000	& cn8< 84659100
	replace cat = "mac_mactl"	if cn8>= 84659100	& cn8< 84659200
	replace cat = "mac_mactl"	if cn8>= 84659200	& cn8< 84659300
	replace cat = "mac_mactl"	if cn8>= 84659300	& cn8< 84659400
	replace cat = "mac_mactl"	if cn8>= 84659400	& cn8< 84659500
	replace cat = "mac_mactl"	if cn8>= 84659500	& cn8< 84659600
	replace cat = "mac_mactl"	if cn8>= 84659600	& cn8< 84659900
	replace cat = "mac_mactl"	if cn8>= 84659900	& cn8< 84661000
	replace cat = "mac_mactl"	if cn8>= 84661000	& cn8< 84662000
	replace cat = "mac_mactl"	if cn8>= 84662000	& cn8< 84663000
	replace cat = "mac_mactl"	if cn8>= 84663000	& cn8< 84669100
	replace cat = "mac_mactl"	if cn8>= 84669100	& cn8< 84669200
	replace cat = "mac_mactl"	if cn8>= 84669200	& cn8< 84669300
	replace cat = "mac_mactl"	if cn8>= 84669300	& cn8< 84669400
	replace cat = "mac_mactl"	if cn8>= 84669400	& cn8< 84671000	
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84671000	& cn8< 84671900
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84671900	& cn8< 84672100
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84672100	& cn8< 84672200
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84672200	& cn8< 84672900
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84672900	& cn8< 84678100
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84678100	& cn8< 84678900
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84678900	& cn8< 84679100
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84679100	& cn8< 84679200
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84679200	& cn8< 84679900
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84679900	& cn8< 84681000
	replace cat = "mac_mactl_hand_mactl"	if cn8>= 84681000	& cn8< 84682000
	replace cat = "mac_mactl"	if cn8>= 84682000	& cn8< 84688000
	replace cat = "mac_mactl"	if cn8>= 84688000	& cn8< 84689000
	replace cat = "mac_mactl"	if cn8>= 84689000	& cn8< 84690000
	replace cat = "none"	if cn8>= 84690000	& cn8< 84701000
	replace cat = "none"	if cn8>= 84701000	& cn8< 84702100
	replace cat = "none"	if cn8>= 84702100	& cn8< 84702900
	replace cat = "none"	if cn8>= 84702900	& cn8< 84703000
	replace cat = "none"	if cn8>= 84703000	& cn8< 84705000
	replace cat = "none"	if cn8>= 84705000	& cn8< 84709000
	replace cat = "none"	if cn8>= 84709000	& cn8< 84710000
	replace cat = "computer"	if cn8>= 84710000	& cn8< 84714100
	replace cat = "computer"	if cn8>= 84714100	& cn8< 84714900
	replace cat = "computer"	if cn8>= 84714900	& cn8< 84715000
	replace cat = "computer"	if cn8>= 84715000	& cn8< 84716000
	replace cat = "computer"	if cn8>= 84716000	& cn8< 84717000
	replace cat = "computer"	if cn8>= 84717000	& cn8< 84718000
	replace cat = "computer"	if cn8>= 84718000	& cn8< 84719000
	replace cat = "computer"	if cn8>= 84719000	& cn8< 84720000	
	replace cat = "none"	if cn8>= 84720000	& cn8< 84723000
	replace cat = "none"	if cn8>= 84723000	& cn8< 84729000
	replace cat = "none"	if cn8>= 84729000	& cn8< 84731000
	replace cat = "none"	if cn8>= 84731000	& cn8< 84732100
	replace cat = "none"	if cn8>= 84732100	& cn8< 84732900
	replace cat = "none"	if cn8>= 84732900	& cn8< 84733000
	replace cat = "none"	if cn8>= 84733000	& cn8< 84734000
	replace cat = "none"	if cn8>= 84734000	& cn8< 84735000
	replace cat = "none"	if cn8>= 84735000	& cn8< 84741000
	replace cat = "none"	if cn8>= 84741000	& cn8< 84742000
	replace cat = "none"	if cn8>= 84742000	& cn8< 84743100
	replace cat = "none"	if cn8>= 84743100	& cn8< 84743200
	replace cat = "none"	if cn8>= 84743200	& cn8< 84743900
	replace cat = "none"	if cn8>= 84743900	& cn8< 84748000
	replace cat = "none"	if cn8>= 84748000	& cn8< 84749000
	replace cat = "none"	if cn8>= 84749000	& cn8< 84750000	
	replace cat = "mac"	if cn8>= 84750000	& cn8< 84752100
	replace cat = "mac"	if cn8>= 84752100	& cn8< 84752900
	replace cat = "mac"	if cn8>= 84752900	& cn8< 84759000
	replace cat = "mac"	if cn8>= 84759000	& cn8< 84762100
	replace cat = "mac_food_vend"	if cn8>= 84762100	& cn8< 84762900
	replace cat = "mac_food_vend"	if cn8>= 84762900	& cn8< 84768100
	replace cat = "mac_food_vend"	if cn8>= 84768100	& cn8< 84768900
	replace cat = "mac_nonfood_vend"	if cn8>= 84768900	& cn8< 84769000
	replace cat = "mac"	if cn8>= 84769000	& cn8< 84771000
	replace cat = "mac"	if cn8>= 84771000	& cn8< 84772000
	replace cat = "mac"	if cn8>= 84772000	& cn8< 84773000
	replace cat = "mac"	if cn8>= 84773000	& cn8< 84774000
	replace cat = "mac"	if cn8>= 84774000	& cn8< 84775100
	replace cat = "mac"	if cn8>= 84775100	& cn8< 84775900
	replace cat = "mac"	if cn8>= 84775900	& cn8< 84778000
	replace cat = "mac"	if cn8>= 84778000	& cn8< 84779000
	replace cat = "mac"	if cn8>= 84779000	& cn8< 84781000
	replace cat = "mac"	if cn8>= 84781000	& cn8< 84789000
	replace cat = "mac"	if cn8>= 84789000	& cn8< 84791000
	replace cat = "mac"	if cn8>= 84791000	& cn8< 84792000
	replace cat = "mac"	if cn8>= 84792000	& cn8< 84793000
	replace cat = "mac"	if cn8>= 84793000	& cn8< 84794000
	replace cat = "mac"	if cn8>= 84794000	& cn8< 84795000
	replace cat = "mac_robot"	if cn8>= 84795000	& cn8< 84796000
	replace cat = "mac"	if cn8>= 84796000	& cn8< 84797100
	replace cat = "mac"	if cn8>= 84797100	& cn8< 84797900
	replace cat = "mac"	if cn8>= 84797900	& cn8< 84798100
	replace cat = "mac"	if cn8>= 84798100	& cn8< 84798200
	replace cat = "mac"	if cn8>= 84798200	& cn8< 84798900
	replace cat = "mac"	if cn8>= 84798900	& cn8< 84799000
	replace cat = "mac"	if cn8>= 84799000	& cn8< 84800000	
	replace cat = "none"	if cn8>= 84800000	& cn8< 84802000
	replace cat = "none"	if cn8>= 84802000	& cn8< 84803000
	replace cat = "none"	if cn8>= 84803000	& cn8< 84804100
	replace cat = "none"	if cn8>= 84804100	& cn8< 84804900
	replace cat = "none"	if cn8>= 84804900	& cn8< 84805000
	replace cat = "none"	if cn8>= 84805000	& cn8< 84806000
	replace cat = "none"	if cn8>= 84806000	& cn8< 84807100
	replace cat = "none"	if cn8>= 84807100	& cn8< 84807900
	replace cat = "none"	if cn8>= 84807900	& cn8< 84811000
	replace cat = "none"	if cn8>= 84811000	& cn8< 84812000
	replace cat = "none"	if cn8>= 84812000	& cn8< 84813000
	replace cat = "none"	if cn8>= 84813000	& cn8< 84814000
	replace cat = "none"	if cn8>= 84814000	& cn8< 84818000
	replace cat = "none"	if cn8>= 84818000	& cn8< 84819000
	replace cat = "none"	if cn8>= 84819000	& cn8< 84821000
	replace cat = "none"	if cn8>= 84821000	& cn8< 84822000
	replace cat = "none"	if cn8>= 84822000	& cn8< 84823000
	replace cat = "none"	if cn8>= 84823000	& cn8< 84824000
	replace cat = "none"	if cn8>= 84824000	& cn8< 84825000
	replace cat = "none"	if cn8>= 84825000	& cn8< 84828000
	replace cat = "none"	if cn8>= 84828000	& cn8< 84829100
	replace cat = "none"	if cn8>= 84829100	& cn8< 84829900
	replace cat = "none"	if cn8>= 84829900	& cn8< 84831000
	replace cat = "none"	if cn8>= 84831000	& cn8< 84832000
	replace cat = "none"	if cn8>= 84832000	& cn8< 84833000
	replace cat = "none"	if cn8>= 84833000	& cn8< 84834000
	replace cat = "none"	if cn8>= 84834000	& cn8< 84835000
	replace cat = "none"	if cn8>= 84835000	& cn8< 84836000
	replace cat = "none"	if cn8>= 84836000	& cn8< 84839000
	replace cat = "none"	if cn8>= 84839000	& cn8< 84841000
	replace cat = "none"	if cn8>= 84841000	& cn8< 84842000
	replace cat = "none"	if cn8>= 84842000	& cn8< 84849000
	replace cat = "none"	if cn8>= 84849000	& cn8< 84860000	
	replace cat = "mac"	if cn8>= 84860000	& cn8< 84862000
	replace cat = "mac"	if cn8>= 84862000	& cn8< 84863000
	replace cat = "mac"	if cn8>= 84863000	& cn8< 84864000
	replace cat = "mac"	if cn8>= 84864000	& cn8< 84869000
	replace cat = "mac"	if cn8>= 84869000	& cn8< 84870000	
	replace cat = "none"	if cn8>= 84870000	& cn8< 84879000
	replace cat = "none"	if cn8>= 84879000	& cn8< 85010000	
	replace cat = "mac"	if cn8>= 85010000	& cn8< 85012000
	replace cat = "mac"	if cn8>= 85012000	& cn8< 85013100
	replace cat = "mac"	if cn8>= 85013100	& cn8< 85013200
	replace cat = "mac"	if cn8>= 85013200	& cn8< 85013300
	replace cat = "mac"	if cn8>= 85013300	& cn8< 85013400
	replace cat = "mac"	if cn8>= 85013400	& cn8< 85014000
	replace cat = "mac"	if cn8>= 85014000	& cn8< 85015100
	replace cat = "mac"	if cn8>= 85015100	& cn8< 85015200
	replace cat = "mac"	if cn8>= 85015200	& cn8< 85015300
	replace cat = "mac"	if cn8>= 85015300	& cn8< 85016100
	replace cat = "mac"	if cn8>= 85016100	& cn8< 85016200
	replace cat = "mac"	if cn8>= 85016200	& cn8< 85016300
	replace cat = "mac"	if cn8>= 85016300	& cn8< 85016400
	replace cat = "mac"	if cn8>= 85016400	& cn8< 85021100
	replace cat = "mac"	if cn8>= 85021100	& cn8< 85021200
	replace cat = "mac"	if cn8>= 85021200	& cn8< 85021300
	replace cat = "mac"	if cn8>= 85021300	& cn8< 85022000
	replace cat = "mac"	if cn8>= 85022000	& cn8< 85023100
	replace cat = "mac"	if cn8>= 85023100	& cn8< 85023900
	replace cat = "mac"	if cn8>= 85023900	& cn8< 85024000
	replace cat = "mac"	if cn8>= 85024000	& cn8< 85030000
	replace cat = "mac"	if cn8>= 85030000	& cn8< 85041000
	replace cat = "mac"	if cn8>= 85041000	& cn8< 85042100
	replace cat = "mac"	if cn8>= 85042100	& cn8< 85042200
	replace cat = "mac"	if cn8>= 85042200	& cn8< 85042300
	replace cat = "mac"	if cn8>= 85042300	& cn8< 85043100
	replace cat = "mac"	if cn8>= 85043100	& cn8< 85043200
	replace cat = "mac"	if cn8>= 85043200	& cn8< 85043300
	replace cat = "mac"	if cn8>= 85043300	& cn8< 85043400
	replace cat = "mac"	if cn8>= 85043400	& cn8< 85044000
	replace cat = "mac"	if cn8>= 85044000	& cn8< 85045000
	replace cat = "mac"	if cn8>= 85045000	& cn8< 85049000
	replace cat = "mac"	if cn8>= 85049000	& cn8< 85051100
	replace cat = "mac"	if cn8>= 85051100	& cn8< 85051900
	replace cat = "mac"	if cn8>= 85051900	& cn8< 85052000
	replace cat = "mac"	if cn8>= 85052000	& cn8< 85059000
	replace cat = "mac"	if cn8>= 85059000	& cn8< 85061000
	replace cat = "mac"	if cn8>= 85061000	& cn8< 85063000
	replace cat = "mac"	if cn8>= 85063000	& cn8< 85064000
	replace cat = "mac"	if cn8>= 85064000	& cn8< 85065000
	replace cat = "mac"	if cn8>= 85065000	& cn8< 85066000
	replace cat = "mac"	if cn8>= 85066000	& cn8< 85068000
	replace cat = "mac"	if cn8>= 85068000	& cn8< 85069000
	replace cat = "mac"	if cn8>= 85069000	& cn8< 85071000
	replace cat = "mac"	if cn8>= 85071000	& cn8< 85072000
	replace cat = "mac"	if cn8>= 85072000	& cn8< 85073000
	replace cat = "mac"	if cn8>= 85073000	& cn8< 85074000
	replace cat = "mac"	if cn8>= 85074000	& cn8< 85075000
	replace cat = "mac"	if cn8>= 85075000	& cn8< 85076000
	replace cat = "mac"	if cn8>= 85076000	& cn8< 85078000
	replace cat = "mac"	if cn8>= 85078000	& cn8< 85079000
	replace cat = "mac"	if cn8>= 85079000	& cn8< 85081000	
	replace cat = "none"	if cn8>= 85081000	& cn8< 85081900
	replace cat = "none"	if cn8>= 85081900	& cn8< 85086000
	replace cat = "none"	if cn8>= 85086000	& cn8< 85087000
	replace cat = "none"	if cn8>= 85087000	& cn8< 85094000
	replace cat = "none"	if cn8>= 85094000	& cn8< 85098000
	replace cat = "none"	if cn8>= 85098000	& cn8< 85099000
	replace cat = "none"	if cn8>= 85099000	& cn8< 85101000
	replace cat = "none"	if cn8>= 85101000	& cn8< 85102000
	replace cat = "none"	if cn8>= 85102000	& cn8< 85103000
	replace cat = "none"	if cn8>= 85103000	& cn8< 85109000
	replace cat = "none"	if cn8>= 85109000	& cn8< 85111000
	replace cat = "none"	if cn8>= 85111000	& cn8< 85112000
	replace cat = "none"	if cn8>= 85112000	& cn8< 85113000
	replace cat = "none"	if cn8>= 85113000	& cn8< 85114000
	replace cat = "none"	if cn8>= 85114000	& cn8< 85115000
	replace cat = "none"	if cn8>= 85115000	& cn8< 85118000
	replace cat = "none"	if cn8>= 85118000	& cn8< 85119000
	replace cat = "none"	if cn8>= 85119000	& cn8< 85121000
	replace cat = "none"	if cn8>= 85121000	& cn8< 85122000
	replace cat = "none"	if cn8>= 85122000	& cn8< 85123000
	replace cat = "none"	if cn8>= 85123000	& cn8< 85124000
	replace cat = "none"	if cn8>= 85124000	& cn8< 85129000
	replace cat = "none"	if cn8>= 85129000	& cn8< 85131000
	replace cat = "none"	if cn8>= 85131000	& cn8< 85139000
	replace cat = "none"	if cn8>= 85139000	& cn8< 85140000	
	replace cat = "mac"	if cn8>= 85140000	& cn8< 85142000
	replace cat = "mac"	if cn8>= 85142000	& cn8< 85143000
	replace cat = "mac"	if cn8>= 85143000	& cn8< 85144000
	replace cat = "mac"	if cn8>= 85144000	& cn8< 85149000
	replace cat = "mac"	if cn8>= 85149000	& cn8< 85151100
	replace cat = "mac_mactl"	if cn8>= 85151100	& cn8< 85151900
	replace cat = "mac_mactl"	if cn8>= 85151900	& cn8< 85152100
	replace cat = "mac_aut_weld"	if cn8>= 85152100	& cn8< 85152900
	replace cat = "mac_nonaut_weld"	if cn8>= 85152900	& cn8< 85153100
	replace cat = "mac_aut_weld"	if cn8>= 85153100	& cn8< 85153900
	replace cat = "mac_nonaut_weld"	if cn8>= 85153900	& cn8< 85158000
	replace cat = "mac_nonaut_weld"	if cn8>= 85158000	& cn8< 85159000
	replace cat = "mac_nonaut_weld"	if cn8>= 85159000	& cn8< 85160000	
	replace cat = "none"	if cn8>= 85160000	& cn8< 85162100
	replace cat = "none"	if cn8>= 85162100	& cn8< 85162900
	replace cat = "none"	if cn8>= 85162900	& cn8< 85163100
	replace cat = "none"	if cn8>= 85163100	& cn8< 85163200
	replace cat = "none"	if cn8>= 85163200	& cn8< 85163300
	replace cat = "none"	if cn8>= 85163300	& cn8< 85164000
	replace cat = "none"	if cn8>= 85164000	& cn8< 85165000
	replace cat = "none"	if cn8>= 85165000	& cn8< 85166000
	replace cat = "none"	if cn8>= 85166000	& cn8< 85167100
	replace cat = "none"	if cn8>= 85167100	& cn8< 85167200
	replace cat = "none"	if cn8>= 85167200	& cn8< 85167900
	replace cat = "none"	if cn8>= 85167900	& cn8< 85168000
	replace cat = "none"	if cn8>= 85168000	& cn8< 85169000
	replace cat = "none"	if cn8>= 85169000	& cn8< 85171100
	replace cat = "none"	if cn8>= 85171100	& cn8< 85171200
	replace cat = "none"	if cn8>= 85171200	& cn8< 85171800
	replace cat = "none"	if cn8>= 85171800	& cn8< 85176100
	replace cat = "none"	if cn8>= 85176100	& cn8< 85176200
	replace cat = "none"	if cn8>= 85176200	& cn8< 85176900
	replace cat = "none"	if cn8>= 85176900	& cn8< 85177000
	replace cat = "none"	if cn8>= 85177000	& cn8< 85181000
	replace cat = "none"	if cn8>= 85181000	& cn8< 85182100
	replace cat = "none"	if cn8>= 85182100	& cn8< 85182200
	replace cat = "none"	if cn8>= 85182200	& cn8< 85182900
	replace cat = "none"	if cn8>= 85182900	& cn8< 85183000
	replace cat = "none"	if cn8>= 85183000	& cn8< 85184000
	replace cat = "none"	if cn8>= 85184000	& cn8< 85185000
	replace cat = "none"	if cn8>= 85185000	& cn8< 85189000
	replace cat = "none"	if cn8>= 85189000	& cn8< 85192000
	replace cat = "none"	if cn8>= 85192000	& cn8< 85193000
	replace cat = "none"	if cn8>= 85193000	& cn8< 85195000
	replace cat = "none"	if cn8>= 85195000	& cn8< 85198100
	replace cat = "none"	if cn8>= 85198100	& cn8< 85198900
	replace cat = "none"	if cn8>= 85198900	& cn8< 85211000
	replace cat = "none"	if cn8>= 85211000	& cn8< 85219000
	replace cat = "none"	if cn8>= 85219000	& cn8< 85221000
	replace cat = "none"	if cn8>= 85221000	& cn8< 85229000
	replace cat = "none"	if cn8>= 85229000	& cn8< 85232100
	replace cat = "none"	if cn8>= 85232100	& cn8< 85232900
	replace cat = "none"	if cn8>= 85232900	& cn8< 85234100
	replace cat = "none"	if cn8>= 85234100	& cn8< 85234900
	replace cat = "none"	if cn8>= 85234900	& cn8< 85235100
	replace cat = "none"	if cn8>= 85235100	& cn8< 85235200
	replace cat = "none"	if cn8>= 85235200	& cn8< 85235900
	replace cat = "none"	if cn8>= 85235900	& cn8< 85238000
	replace cat = "none"	if cn8>= 85238000	& cn8< 85255000
	replace cat = "none"	if cn8>= 85255000	& cn8< 85256000
	replace cat = "none"	if cn8>= 85256000	& cn8< 85258000
	replace cat = "none"	if cn8>= 85258000	& cn8< 85261000
	replace cat = "none"	if cn8>= 85261000	& cn8< 85269100
	replace cat = "none"	if cn8>= 85269100	& cn8< 85269200
	replace cat = "none"	if cn8>= 85269200	& cn8< 85271200
	replace cat = "none"	if cn8>= 85271200	& cn8< 85271300
	replace cat = "none"	if cn8>= 85271300	& cn8< 85271900
	replace cat = "none"	if cn8>= 85271900	& cn8< 85272100
	replace cat = "none"	if cn8>= 85272100	& cn8< 85272900
	replace cat = "none"	if cn8>= 85272900	& cn8< 85279100
	replace cat = "none"	if cn8>= 85279100	& cn8< 85279200
	replace cat = "none"	if cn8>= 85279200	& cn8< 85279900
	replace cat = "none"	if cn8>= 85279900	& cn8< 85284100
	replace cat = "none"	if cn8>= 85284100	& cn8< 85284900
	replace cat = "none"	if cn8>= 85284900	& cn8< 85285100
	replace cat = "none"	if cn8>= 85285100	& cn8< 85285900
	replace cat = "none"	if cn8>= 85285900	& cn8< 85286100
	replace cat = "none"	if cn8>= 85286100	& cn8< 85286900
	replace cat = "none"	if cn8>= 85286900	& cn8< 85287100
	replace cat = "none"	if cn8>= 85287100	& cn8< 85287200
	replace cat = "none"	if cn8>= 85287200	& cn8< 85287300
	replace cat = "none"	if cn8>= 85287300	& cn8< 85291000
	replace cat = "none"	if cn8>= 85291000	& cn8< 85299000
	replace cat = "none"	if cn8>= 85299000	& cn8< 85301000
	replace cat = "none"	if cn8>= 85301000	& cn8< 85308000
	replace cat = "none"	if cn8>= 85308000	& cn8< 85309000
	replace cat = "none"	if cn8>= 85309000	& cn8< 85311000
	replace cat = "none"	if cn8>= 85311000	& cn8< 85312000
	replace cat = "none"	if cn8>= 85312000	& cn8< 85318000
	replace cat = "none"	if cn8>= 85318000	& cn8< 85319000
	replace cat = "none"	if cn8>= 85319000	& cn8< 85321000
	replace cat = "none"	if cn8>= 85321000	& cn8< 85322100
	replace cat = "none"	if cn8>= 85322100	& cn8< 85322200
	replace cat = "none"	if cn8>= 85322200	& cn8< 85322300
	replace cat = "none"	if cn8>= 85322300	& cn8< 85322400
	replace cat = "none"	if cn8>= 85322400	& cn8< 85322500
	replace cat = "none"	if cn8>= 85322500	& cn8< 85322900
	replace cat = "none"	if cn8>= 85322900	& cn8< 85323000
	replace cat = "none"	if cn8>= 85323000	& cn8< 85329000
	replace cat = "none"	if cn8>= 85329000	& cn8< 85331000
	replace cat = "none"	if cn8>= 85331000	& cn8< 85332100
	replace cat = "none"	if cn8>= 85332100	& cn8< 85332900
	replace cat = "none"	if cn8>= 85332900	& cn8< 85333100
	replace cat = "none"	if cn8>= 85333100	& cn8< 85333900
	replace cat = "none"	if cn8>= 85333900	& cn8< 85334000
	replace cat = "none"	if cn8>= 85334000	& cn8< 85339000
	replace cat = "none"	if cn8>= 85339000	& cn8< 85340000
	replace cat = "none"	if cn8>= 85340000	& cn8< 85351000
	replace cat = "none"	if cn8>= 85351000	& cn8< 85352100
	replace cat = "none"	if cn8>= 85352100	& cn8< 85352900
	replace cat = "none"	if cn8>= 85352900	& cn8< 85353000
	replace cat = "none"	if cn8>= 85353000	& cn8< 85354000
	replace cat = "none"	if cn8>= 85354000	& cn8< 85359000
	replace cat = "none"	if cn8>= 85359000	& cn8< 85361000
	replace cat = "none"	if cn8>= 85361000	& cn8< 85362000
	replace cat = "none"	if cn8>= 85362000	& cn8< 85363000
	replace cat = "none"	if cn8>= 85363000	& cn8< 85364100
	replace cat = "none"	if cn8>= 85364100	& cn8< 85364900
	replace cat = "none"	if cn8>= 85364900	& cn8< 85365000
	replace cat = "none"	if cn8>= 85365000	& cn8< 85366100
	replace cat = "none"	if cn8>= 85366100	& cn8< 85366900
	replace cat = "none"	if cn8>= 85366900	& cn8< 85367000
	replace cat = "none"	if cn8>= 85367000	& cn8< 85369000
	replace cat = "none"	if cn8>= 85369000	& cn8< 85371000
	replace cat = "none"	if cn8>= 85371000	& cn8< 85372000
	replace cat = "none"	if cn8>= 85372000	& cn8< 85381000
	replace cat = "none"	if cn8>= 85381000	& cn8< 85389000
	replace cat = "none"	if cn8>= 85389000	& cn8< 85391000
	replace cat = "none"	if cn8>= 85391000	& cn8< 85392100
	replace cat = "none"	if cn8>= 85392100	& cn8< 85392200
	replace cat = "none"	if cn8>= 85392200	& cn8< 85392900
	replace cat = "none"	if cn8>= 85392900	& cn8< 85393100
	replace cat = "none"	if cn8>= 85393100	& cn8< 85393200
	replace cat = "none"	if cn8>= 85393200	& cn8< 85393900
	replace cat = "none"	if cn8>= 85393900	& cn8< 85394100
	replace cat = "none"	if cn8>= 85394100	& cn8< 85394900
	replace cat = "none"	if cn8>= 85394900	& cn8< 85399000
	replace cat = "none"	if cn8>= 85399000	& cn8< 85401100
	replace cat = "none"	if cn8>= 85401100	& cn8< 85401200
	replace cat = "none"	if cn8>= 85401200	& cn8< 85402000
	replace cat = "none"	if cn8>= 85402000	& cn8< 85404000
	replace cat = "none"	if cn8>= 85404000	& cn8< 85406000
	replace cat = "none"	if cn8>= 85406000	& cn8< 85407100
	replace cat = "none"	if cn8>= 85407100	& cn8< 85407900
	replace cat = "none"	if cn8>= 85407900	& cn8< 85408100
	replace cat = "none"	if cn8>= 85408100	& cn8< 85408900
	replace cat = "none"	if cn8>= 85408900	& cn8< 85409100
	replace cat = "none"	if cn8>= 85409100	& cn8< 85409900
	replace cat = "none"	if cn8>= 85409900	& cn8< 85411000
	replace cat = "none"	if cn8>= 85411000	& cn8< 85412100
	replace cat = "none"	if cn8>= 85412100	& cn8< 85412900
	replace cat = "none"	if cn8>= 85412900	& cn8< 85413000
	replace cat = "none"	if cn8>= 85413000	& cn8< 85414000
	replace cat = "none"	if cn8>= 85414000	& cn8< 85415000
	replace cat = "none"	if cn8>= 85415000	& cn8< 85416000
	replace cat = "none"	if cn8>= 85416000	& cn8< 85419000
	replace cat = "none"	if cn8>= 85419000	& cn8< 85423100
	replace cat = "none"	if cn8>= 85423100	& cn8< 85423200
	replace cat = "none"	if cn8>= 85423200	& cn8< 85423300
	replace cat = "none"	if cn8>= 85423300	& cn8< 85423900
	replace cat = "none"	if cn8>= 85423900	& cn8< 85429000
	replace cat = "none"	if cn8>= 85429000	& cn8< 85431000
	replace cat = "none"	if cn8>= 85431000	& cn8< 85432000
	replace cat = "none"	if cn8>= 85432000	& cn8< 85433000
	replace cat = "none"	if cn8>= 85433000	& cn8< 85437000
	replace cat = "none"	if cn8>= 85437000	& cn8< 85439000
	replace cat = "none"	if cn8>= 85439000	& cn8< 85441100
	replace cat = "none"	if cn8>= 85441100	& cn8< 85441900
	replace cat = "none"	if cn8>= 85441900	& cn8< 85442000
	replace cat = "none"	if cn8>= 85442000	& cn8< 85443000
	replace cat = "none"	if cn8>= 85443000	& cn8< 85444200
	replace cat = "none"	if cn8>= 85444200	& cn8< 85444900
	replace cat = "none"	if cn8>= 85444900	& cn8< 85446000
	replace cat = "none"	if cn8>= 85446000	& cn8< 85447000
	replace cat = "none"	if cn8>= 85447000	& cn8< 85451100
	replace cat = "none"	if cn8>= 85451100	& cn8< 85451900
	replace cat = "none"	if cn8>= 85451900	& cn8< 85452000
	replace cat = "none"	if cn8>= 85452000	& cn8< 85459000
	replace cat = "none"	if cn8>= 85459000	& cn8< 85461000
	replace cat = "none"	if cn8>= 85461000	& cn8< 85462000
	replace cat = "none"	if cn8>= 85462000	& cn8< 85469000
	replace cat = "none"	if cn8>= 85469000	& cn8< 85471000
	replace cat = "none"	if cn8>= 85471000	& cn8< 85472000
	replace cat = "none"	if cn8>= 85472000	& cn8< 85479000
	replace cat = "none"	if cn8>= 85479000	& cn8< 85481000
	replace cat = "none"	if cn8>= 85481000	& cn8< 85489000
	replace cat = "none"	if cn8>= 85489000	& cn8< 87010000	
	replace cat = "agri"	if cn8>= 87010000	& cn8< 87012000
	replace cat = "agri"	if cn8>= 87012000	& cn8< 87013000
	replace cat = "agri"	if cn8>= 87013000	& cn8< 87019000
	replace cat = "agri"	if cn8>= 87019000	& cn8< 87020000	
	replace cat = "none"	if cn8>= 87020000	& cn8< 87029000
	replace cat = "none"	if cn8>= 87029000	& cn8< 87031000
	replace cat = "none"	if cn8>= 87031000	& cn8< 87032100
	replace cat = "none"	if cn8>= 87032100	& cn8< 87032200
	replace cat = "none"	if cn8>= 87032200	& cn8< 87032300
	replace cat = "none"	if cn8>= 87032300	& cn8< 87032400
	replace cat = "none"	if cn8>= 87032400	& cn8< 87033100
	replace cat = "none"	if cn8>= 87033100	& cn8< 87033200
	replace cat = "none"	if cn8>= 87033200	& cn8< 87033300
	replace cat = "none"	if cn8>= 87033300	& cn8< 87039000
	replace cat = "none"	if cn8>= 87039000	& cn8< 87041000
	replace cat = "none"	if cn8>= 87041000	& cn8< 87042100
	replace cat = "none"	if cn8>= 87042100	& cn8< 87042200
	replace cat = "none"	if cn8>= 87042200	& cn8< 87042300
	replace cat = "none"	if cn8>= 87042300	& cn8< 87043100
	replace cat = "none"	if cn8>= 87043100	& cn8< 87043200
	replace cat = "none"	if cn8>= 87043200	& cn8< 87049000
	replace cat = "none"	if cn8>= 87049000	& cn8< 87051000
	replace cat = "none"	if cn8>= 87051000	& cn8< 87052000
	replace cat = "none"	if cn8>= 87052000	& cn8< 87053000
	replace cat = "none"	if cn8>= 87053000	& cn8< 87054000
	replace cat = "none"	if cn8>= 87054000	& cn8< 87059000
	replace cat = "none"	if cn8>= 87059000	& cn8< 87060000
	replace cat = "none"	if cn8>= 87060000	& cn8< 87071000
	replace cat = "none"	if cn8>= 87071000	& cn8< 87079000
	replace cat = "none"	if cn8>= 87079000	& cn8< 87081000
	replace cat = "none"	if cn8>= 87081000	& cn8< 87082100
	replace cat = "none"	if cn8>= 87082100	& cn8< 87082900
	replace cat = "none"	if cn8>= 87082900	& cn8< 87083000
	replace cat = "none"	if cn8>= 87083000	& cn8< 87084000
	replace cat = "none"	if cn8>= 87084000	& cn8< 87085000
	replace cat = "none"	if cn8>= 87085000	& cn8< 87087000
	replace cat = "none"	if cn8>= 87087000	& cn8< 87088000
	replace cat = "none"	if cn8>= 87088000	& cn8< 87089100
	replace cat = "none"	if cn8>= 87089100	& cn8< 87089200
	replace cat = "none"	if cn8>= 87089200	& cn8< 87089300
	replace cat = "none"	if cn8>= 87089300	& cn8< 87089400
	replace cat = "none"	if cn8>= 87089400	& cn8< 87089500
	replace cat = "none"	if cn8>= 87089500	& cn8< 87089900
	replace cat = "none"	if cn8>= 87089900	& cn8< 87091000	
	replace cat = "mac_other_transfer"	if cn8>= 87091000	& cn8< 87091900
	replace cat = "mac_other_transfer"	if cn8>= 87091900	& cn8< 87099000
	replace cat = "mac_other_transfer"	if cn8>= 87099000	& cn8< 87100000
	replace cat = "none"	if cn8>= 87100000	& cn8< 87111000
	replace cat = "none"	if cn8>= 87111000	& cn8< 87112000
	replace cat = "none"	if cn8>= 87112000	& cn8< 87113000
	replace cat = "none"	if cn8>= 87113000	& cn8< 87114000
	replace cat = "none"	if cn8>= 87114000	& cn8< 87115000
	replace cat = "none"	if cn8>= 87115000	& cn8< 87119000
	replace cat = "none"	if cn8>= 87119000	& cn8< 87120000
	replace cat = "none"	if cn8>= 87120000	& cn8< 87131000
	replace cat = "none"	if cn8>= 87131000	& cn8< 87139000
	replace cat = "none"	if cn8>= 87139000	& cn8< 87141000
	replace cat = "none"	if cn8>= 87141000	& cn8< 87142000
	replace cat = "none"	if cn8>= 87142000	& cn8< 87149100
	replace cat = "none"	if cn8>= 87149100	& cn8< 87149200
	replace cat = "none"	if cn8>= 87149200	& cn8< 87149300
	replace cat = "none"	if cn8>= 87149300	& cn8< 87149400
	replace cat = "none"	if cn8>= 87149400	& cn8< 87149500
	replace cat = "none"	if cn8>= 87149500	& cn8< 87149600
	replace cat = "none"	if cn8>= 87149600	& cn8< 87149900
	replace cat = "none"	if cn8>= 87149900	& cn8< 87150000
	replace cat = "none"	if cn8>= 87150000	& cn8< 87161000
	replace cat = "none"	if cn8>= 87161000	& cn8< 87162000
	replace cat = "none"	if cn8>= 87162000	& cn8< 87163100
	replace cat = "none"	if cn8>= 87163100	& cn8< 87163900
	replace cat = "none"	if cn8>= 87163900	& cn8< 87164000
	replace cat = "none"	if cn8>= 87164000	& cn8< 87168000
	replace cat = "none"	if cn8>= 87168000	& cn8< 87169000
	replace cat = "none"	if cn8>= 87169000	& cn8< 90011000
	replace cat = "none"	if cn8>= 90011000	& cn8< 90012000
	replace cat = "none"	if cn8>= 90012000	& cn8< 90013000
	replace cat = "none"	if cn8>= 90013000	& cn8< 90014000
	replace cat = "none"	if cn8>= 90014000	& cn8< 90015000
	replace cat = "none"	if cn8>= 90015000	& cn8< 90019000
	replace cat = "none"	if cn8>= 90019000	& cn8< 90021100
	replace cat = "none"	if cn8>= 90021100	& cn8< 90021900
	replace cat = "none"	if cn8>= 90021900	& cn8< 90022000
	replace cat = "none"	if cn8>= 90022000	& cn8< 90029000
	replace cat = "none"	if cn8>= 90029000	& cn8< 90031100
	replace cat = "none"	if cn8>= 90031100	& cn8< 90031900
	replace cat = "none"	if cn8>= 90031900	& cn8< 90039000
	replace cat = "none"	if cn8>= 90039000	& cn8< 90041000
	replace cat = "none"	if cn8>= 90041000	& cn8< 90049000
	replace cat = "none"	if cn8>= 90049000	& cn8< 90051000
	replace cat = "none"	if cn8>= 90051000	& cn8< 90058000
	replace cat = "none"	if cn8>= 90058000	& cn8< 90059000
	replace cat = "none"	if cn8>= 90059000	& cn8< 90061000
	replace cat = "none"	if cn8>= 90061000	& cn8< 90063000
	replace cat = "none"	if cn8>= 90063000	& cn8< 90064000
	replace cat = "none"	if cn8>= 90064000	& cn8< 90065100
	replace cat = "none"	if cn8>= 90065100	& cn8< 90065200
	replace cat = "none"	if cn8>= 90065200	& cn8< 90065300
	replace cat = "none"	if cn8>= 90065300	& cn8< 90065900
	replace cat = "none"	if cn8>= 90065900	& cn8< 90066100
	replace cat = "none"	if cn8>= 90066100	& cn8< 90066900
	replace cat = "none"	if cn8>= 90066900	& cn8< 90069100
	replace cat = "none"	if cn8>= 90069100	& cn8< 90069900
	replace cat = "none"	if cn8>= 90069900	& cn8< 90071000
	replace cat = "none"	if cn8>= 90071000	& cn8< 90072000
	replace cat = "none"	if cn8>= 90072000	& cn8< 90079100
	replace cat = "none"	if cn8>= 90079100	& cn8< 90079200
	replace cat = "none"	if cn8>= 90079200	& cn8< 90085000
	replace cat = "none"	if cn8>= 90085000	& cn8< 90089000
	replace cat = "none"	if cn8>= 90089000	& cn8< 90101000
	replace cat = "none"	if cn8>= 90101000	& cn8< 90105000
	replace cat = "none"	if cn8>= 90105000	& cn8< 90106000
	replace cat = "none"	if cn8>= 90106000	& cn8< 90109000
	replace cat = "none"	if cn8>= 90109000	& cn8< 90111000
	replace cat = "none"	if cn8>= 90111000	& cn8< 90112000
	replace cat = "none"	if cn8>= 90112000	& cn8< 90118000
	replace cat = "none"	if cn8>= 90118000	& cn8< 90119000
	replace cat = "none"	if cn8>= 90119000	& cn8< 90121000
	replace cat = "none"	if cn8>= 90121000	& cn8< 90129000
	replace cat = "none"	if cn8>= 90129000	& cn8< 90131000
	replace cat = "none"	if cn8>= 90131000	& cn8< 90132000
	replace cat = "none"	if cn8>= 90132000	& cn8< 90138000
	replace cat = "none"	if cn8>= 90138000	& cn8< 90139000
	replace cat = "none"	if cn8>= 90139000	& cn8< 90141000
	replace cat = "none"	if cn8>= 90141000	& cn8< 90142000
	replace cat = "none"	if cn8>= 90142000	& cn8< 90148000
	replace cat = "none"	if cn8>= 90148000	& cn8< 90149000
	replace cat = "none"	if cn8>= 90149000	& cn8< 90151000
	replace cat = "none"	if cn8>= 90151000	& cn8< 90152000
	replace cat = "none"	if cn8>= 90152000	& cn8< 90153000
	replace cat = "none"	if cn8>= 90153000	& cn8< 90154000
	replace cat = "none"	if cn8>= 90154000	& cn8< 90158000
	replace cat = "none"	if cn8>= 90158000	& cn8< 90159000
	replace cat = "none"	if cn8>= 90159000	& cn8< 90160000
	replace cat = "none"	if cn8>= 90160000	& cn8< 90171000
	replace cat = "none"	if cn8>= 90171000	& cn8< 90172000
	replace cat = "none"	if cn8>= 90172000	& cn8< 90173000
	replace cat = "none"	if cn8>= 90173000	& cn8< 90178000
	replace cat = "none"	if cn8>= 90178000	& cn8< 90179000
	replace cat = "none"	if cn8>= 90179000	& cn8< 90181100
	replace cat = "none"	if cn8>= 90181100	& cn8< 90181200
	replace cat = "none"	if cn8>= 90181200	& cn8< 90181300
	replace cat = "none"	if cn8>= 90181300	& cn8< 90181400
	replace cat = "none"	if cn8>= 90181400	& cn8< 90181900
	replace cat = "none"	if cn8>= 90181900	& cn8< 90182000
	replace cat = "none"	if cn8>= 90182000	& cn8< 90183100
	replace cat = "none"	if cn8>= 90183100	& cn8< 90183200
	replace cat = "none"	if cn8>= 90183200	& cn8< 90183900
	replace cat = "none"	if cn8>= 90183900	& cn8< 90184100
	replace cat = "none"	if cn8>= 90184100	& cn8< 90184900
	replace cat = "none"	if cn8>= 90184900	& cn8< 90185000
	replace cat = "none"	if cn8>= 90185000	& cn8< 90189000
	replace cat = "none"	if cn8>= 90189000	& cn8< 90191000
	replace cat = "none"	if cn8>= 90191000	& cn8< 90192000
	replace cat = "none"	if cn8>= 90192000	& cn8< 90200000
	replace cat = "none"	if cn8>= 90200000	& cn8< 90211000
	replace cat = "none"	if cn8>= 90211000	& cn8< 90212100
	replace cat = "none"	if cn8>= 90212100	& cn8< 90212900
	replace cat = "none"	if cn8>= 90212900	& cn8< 90213100
	replace cat = "none"	if cn8>= 90213100	& cn8< 90213900
	replace cat = "none"	if cn8>= 90213900	& cn8< 90214000
	replace cat = "none"	if cn8>= 90214000	& cn8< 90215000
	replace cat = "none"	if cn8>= 90215000	& cn8< 90219000
	replace cat = "none"	if cn8>= 90219000	& cn8< 90221200
	replace cat = "none"	if cn8>= 90221200	& cn8< 90221300
	replace cat = "none"	if cn8>= 90221300	& cn8< 90221400
	replace cat = "none"	if cn8>= 90221400	& cn8< 90221900
	replace cat = "none"	if cn8>= 90221900	& cn8< 90222100
	replace cat = "none"	if cn8>= 90222100	& cn8< 90222900
	replace cat = "none"	if cn8>= 90222900	& cn8< 90223000
	replace cat = "none"	if cn8>= 90223000	& cn8< 90229000
	replace cat = "none"	if cn8>= 90229000	& cn8< 90230000
	replace cat = "none"	if cn8>= 90230000	& cn8< 90241000
	replace cat = "mac"	if cn8>= 90241000	& cn8< 90248000
	replace cat = "mac"	if cn8>= 90248000	& cn8< 90249000
	replace cat = "mac"	if cn8>= 90249000	& cn8< 90251000	
	replace cat = "mac_other_ctrl"	if cn8>= 90251000	& cn8< 90251900
	replace cat = "mac_other_ctrl"	if cn8>= 90251900	& cn8< 90258000
	replace cat = "mac_other_ctrl"	if cn8>= 90258000	& cn8< 90259000
	replace cat = "mac_other_ctrl"	if cn8>= 90259000	& cn8< 90261000
	replace cat = "mac_other_ctrl"	if cn8>= 90261000	& cn8< 90262000
	replace cat = "mac_other_ctrl"	if cn8>= 90262000	& cn8< 90268000
	replace cat = "mac_other_ctrl"	if cn8>= 90268000	& cn8< 90269000
	replace cat = "mac_other_ctrl"	if cn8>= 90269000	& cn8< 90271000
	replace cat = "mac_other_ctrl"	if cn8>= 90271000	& cn8< 90272000
	replace cat = "mac_other_ctrl"	if cn8>= 90272000	& cn8< 90273000
	replace cat = "mac_other_ctrl"	if cn8>= 90273000	& cn8< 90275000
	replace cat = "mac_other_ctrl"	if cn8>= 90275000	& cn8< 90278000
	replace cat = "mac_other_ctrl"	if cn8>= 90278000	& cn8< 90279000
	replace cat = "mac_other_ctrl"	if cn8>= 90279000	& cn8< 90281000
	replace cat = "mac_other_ctrl"	if cn8>= 90281000	& cn8< 90282000
	replace cat = "mac_other_ctrl"	if cn8>= 90282000	& cn8< 90283000
	replace cat = "mac_other_ctrl"	if cn8>= 90283000	& cn8< 90289000
	replace cat = "mac_other_ctrl"	if cn8>= 90289000	& cn8< 90291000
	replace cat = "mac_other_ctrl"	if cn8>= 90291000	& cn8< 90292000
	replace cat = "mac_other_ctrl"	if cn8>= 90292000	& cn8< 90299000
	replace cat = "mac_other_ctrl"	if cn8>= 90299000	& cn8< 90301000
	replace cat = "mac_other_ctrl"	if cn8>= 90301000	& cn8< 90302000
	replace cat = "mac_other_ctrl"	if cn8>= 90302000	& cn8< 90303100
	replace cat = "mac_other_ctrl"	if cn8>= 90303100	& cn8< 90303200
	replace cat = "mac_other_ctrl"	if cn8>= 90303200	& cn8< 90303300
	replace cat = "mac_other_ctrl"	if cn8>= 90303300	& cn8< 90303900
	replace cat = "mac_other_ctrl"	if cn8>= 90303900	& cn8< 90304000
	replace cat = "mac_other_ctrl"	if cn8>= 90304000	& cn8< 90308200
	replace cat = "mac_other_ctrl"	if cn8>= 90308200	& cn8< 90308400
	replace cat = "mac_other_ctrl"	if cn8>= 90308400	& cn8< 90308900
	replace cat = "mac_other_ctrl"	if cn8>= 90308900	& cn8< 90309000
	replace cat = "mac_other_ctrl"	if cn8>= 90309000	& cn8< 90311000
	replace cat = "mac_other_ctrl"	if cn8>= 90311000	& cn8< 90312000
	replace cat = "mac_other_ctrl"	if cn8>= 90312000	& cn8< 90314100
	replace cat = "mac_other_ctrl"	if cn8>= 90314100	& cn8< 90314900
	replace cat = "mac_other_ctrl"	if cn8>= 90314900	& cn8< 90318000
	replace cat = "mac_other_ctrl"	if cn8>= 90318000	& cn8< 90319000
	replace cat = "mac_other_ctrl"	if cn8>= 90319000	& cn8< 90320000	
	replace cat = "mac_aut_ctrl"	if cn8>= 90320000	& cn8< 90322000
	replace cat = "mac_aut_ctrl"	if cn8>= 90322000	& cn8< 90328100
	replace cat = "mac_aut_ctrl"	if cn8>= 90328100	& cn8< 90328900
	replace cat = "mac_aut_ctrl"	if cn8>= 90328900	& cn8< 90329000
	replace cat = "mac_aut_ctrl"	if cn8>= 90329000	& cn8< 90330000
	replace cat = "none"	if cn8>= 90330000		
	replace cat = "other"	if cat=="" /*only intermediates assigned, this category are non-intermediates*/	

	*some category recodings they do on top of this:
		*textiles*
	replace cat= "other" 				if cn8>=84521000 & cn8< 84522100 /*sewing machines, household type*/
	replace cat= "mac_laundry" 			if cn8>= 84500000 & cn8< 84515000 /*laundry type*/
	replace cat= "mac_other_textile" 	if cn8>= 84522100 & cn8< 84522900 /*automatic sewing machines to other textile dedicated machinery*/
		*vending machines*
	replace cat= "mac_vending" 			if cn8>= 84760000	& cn8< 84770000
	

* Construct AR measure
	gen AR = 1 if cat=="agri" | cat=="computer" | cat=="mac" | cat=="mac_aut_ctrl" | cat=="mac_aut_transfer" | cat=="mac_aut_weld" | cat=="mac_vending" ///
				| cat=="mac_foodprep" | cat=="mac_mactl" | cat=="mac_mactl_hand_mactl" | cat=="mac_nonaut_weld" | cat=="mac_not_numctrl" /// 
				| cat=="mac_numctrl" | cat=="mac_other_ctrl" | cat=="mac_other_textile" | cat=="mac_other_transfer" | cat=="mac_robot" ///
				| cat=="mac_weavknit_textile" | cat=="mac_laundry" | cat=="none"
	recode AR (.=0)
	label var AR "=1 if CN 8-digit code belongs to Acemoglu-Restrepo 2018 definition of intermediates"

* Construct adjusted AR measure, keeping only automation-related tech
	* Remove these categories: 
	* 	none (spades, shovels, scissors, padlocks, hinges, boilers, steam turbines, bulldozers etc);
	*	mac_other_transfer (non-automated transfer like cranes)
	* 	mac_laundry (washing machines etc)
	*	mac_not_numctrl (not numerically controlled machines, like handheld drill)
	*	mac_mactl_hand_mactl (handheld machine tools, like chainsaws)
	*	mac_vending (vending machines)
	*	mac_nonaut_weld (non-automatic welding machines)
	*	mac_other_ctrl (non-automatically controlled machines)
	gen AR_aut = AR
	replace AR_aut = 0 if cat=="computer" | cat=="none" | cat=="mac_other_transfer"  | cat=="mac_laundry" | cat=="mac_not_numctrl" | cat=="mac_mactl_hand_mactl" ///
						| cat=="mac_vending" | cat=="mac_nonaut_weld" | cat=="mac_other_ctrl" 
	label var AR_aut "AR automation, set to 0 for non-automated machines"

* Construct second, more restrictive, adjusted AR measure
	gen AR_aut2 = 1 if cat=="mac_robot" | cat=="mac_numctrl" | cat=="mac_aut_ctrl" | cat=="mac_aut_transfer" | cat=="mac_aut_weld"
	recode AR_aut2 (.=0)
	label var AR_aut2 "AR automation, only robot, numctrl, aut_ctrl, aut_transfer, aut_weld"
	
* Construct robot AR measure, keeping only robot-related tech
	gen AR_robot = 1 if cat=="mac_robot"
	recode AR_robot (.=0)
	label var AR_robot "=1 if CN 8-digit code belongs to Acemoglu-Restrepo 2018 definition of robot"

* Overview of which category is in which measure
	table cat, c(mean AR mean AR_aut mean AR_aut2 mean AR_robot)